@model ExternalLoginsViewModel
@{
    ViewLayout = "Layout__Login";

    ViewData["Title"] = "Manage your external logins";
    //ViewData.AddActivePage(ManageNavPages.ExternalLogins);
}

@*@Html.Partial("_StatusMessage", Model.StatusMessage)*@
@if (Model.CurrentLogins?.Count > 0)
{
    <v-card>
        <v-card-title>@T["Registered Logins"]</v-card-title>
        <v-card-text>
            @foreach (var login in Model.CurrentLogins)
            {
                <v-row>
                    <v-col>@login.LoginProvider</v-col>
                    <v-col>
                        @if (Model.ShowRemoveButton)
                        {
                            <form asp-action="RemoveLogin" method="post">
                                <div>
                                    <input asp-for="@login.LoginProvider" name="LoginProvider" type="hidden" />
                                    <input asp-for="@login.ProviderKey" name="ProviderKey" type="hidden" />
                                    <v-btn type="submit" class="btn btn-primary" title="@T["Remove this {0} login from your account", login.LoginProvider]" x-large>Remove</v-btn>
                                </div>
                            </form>
                        }
                        else
                        {
                            @: &nbsp;
                        }
                    </v-col>
                </v-row>
            }
        </v-card-text>
    </v-card>
}
@if (Model.OtherLogins?.Count > 0)
{
    <v-card>
        <v-card-title>@T["Login with another provider"]</v-card-title>
        <v-card-text>
            <form asp-action="LinkLogin" method="post">
                <div id="socialLoginList">
                    @foreach (var provider in Model.OtherLogins)
                    {
                        <v-btn
                            block
                            color="success"
                            name="provider" 
                            title="@T["Log in using your {0} account", provider.DisplayName]"
                            type="submit"
                            value="@provider.Name" 
                            x-large>
                            @provider.DisplayName
                        </v-btn>
                    }
                </div>
            </form>
        </v-card-text>
    </v-card>
}
